Re: [PATCHES] SRA Win32 sync() code

Поиск
Список
Период
Сортировка
От Steve Tibbett
Тема Re: [PATCHES] SRA Win32 sync() code
Дата
Msg-id 3F61636001D91D89@mta3.wss.scd.yahoo.com> (added by postmaster@mail.san.yahoo.com)
обсуждение исходный текст
Список pgsql-hackers-win32
>I was thinking about sync() --- one of its problems is that is schedules
writes
>to disk but returns before it is completed.  If we do sync(), then open,
write,
>fsync, close a file, aren't we then pretty sure all the scheduled sync
writes
>have completed too?  I know SCSI has tagged queueing, but I figured
creating
>a new file and writing/fsync would come after the sync writes.

Sorry to jump in in the middle of this but I'm just wondering if some of the
Win32 file creation flags might help out here.. if the problem is figuring
out how to flush stuff to the disk, what about using FILE_FLAG_NO_BUFFERING?
I'm not sure how you'd create a stdio FILE with custom CreateFile flags but
there's probably a way, I can see if I can figure it out if it looks like it
would be useful.

There are quite a few flags that are Win32 specific but that might help for
various things, like..

FILE_FLAG_DELETE_ON_CLOSE (you can't delete a file while it's open, but you
can open it specifying that it go away when you close it, in the case where
you know it's a temp file).

FILE_ATTRIBUTE_TEMPORARY (an optimization that hints to the filesystem that
this is a temporary file so don't bother writing it to disk (keep it in the
cache) unless you need to).

FILE_FLAG_WRITE_THROUGH (kinda like FILE_FLAG_NO_BUFFERING but different..
the SDK docs describe how they interact).

 - Steve



В списке pgsql-hackers-win32 по дате отправления:

Предыдущее
От: Claudio Natoli
Дата:
Сообщение: Re: fork/exe
Следующее
От: Claudio Natoli
Дата:
Сообщение: Re: fork/exec